const express = require('express');
const router = express.Router();
router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 30; i++)
        content.push({
            id: `2019${i}`,
            code: `WXSP-2019-${i}`,
            dealerCode: `JXS-${i}`,
            dealerShortName: `经销商-${i}`,
            status: 15011002,
            country: '中国',
            brandCode: 'QR',
            originTag: 0,
            vin: `VIN-2019-${i}`,
            model: `奇瑞${i}`,
            customerName: `客户名称${i}`,
            createTime: '2019-09-12T11:27:39.715Z',
            purchaseDate: '2019-09-12T11:27:39.715Z',
            faultType: '25021003',
            authType: 1,
            rowVersion: 'string'
        });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 20
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '1',
            dealerCode: 'JXS',
            dealerName: '经销商',
            code: 'WXSP-2019-1',
            createTime: '2019-09-12T11:27:39.715Z',
            originTag: 0,
            authType: 1,
            faultType: '25021003',
            country: '中国',
            city: '重庆',
            countryCode: '1',
            vin: 'vin-2019-09-15',
            engineCode: 'LV2019-09-10-001',
            transmissionSn: 'BSX-2019-10-31',
            purchaseDate: '2019-09-12T11:27:39.715Z',
            mileage: 10000,
            customerType: '1',
            brand: '奇瑞',
            series: '瑞虎',
            model: '奇瑞',
            customerCompany: '重庆大公司',
            customerName: '重庆刘德华',
            contactPhone: '11111',
            address: '重庆',
            email: '1111',
            subClaimApplyHisCode: '11111',
            supplierCode: '111',
            partBuyDate: '2019-09-12T11:27:39.715Z',
            subletFee: 100,
            faultDescription: 'string',
            analysisResult: 'string',
            appraiser: 'string',
            analysisDate: '2019-09-12T11:27:39.715Z',
            proposedDisposalAdvice: 'string',
            authCode: 'authCode',
            claimApplyDetailHis: [
                {
                    id: '1',
                    usedPartCode: 'JJ0001',
                    usedPartName: '旧件0001',
                    isCaused: false,
                    quantity: 1,
                    price: 520,
                    sumTotal: 520,
                    mngRate: 0.8,
                    manageFee: 568
                }, {
                    id: '2',
                    usedPartCode: 'JJ0001',
                    usedPartName: '旧件0001',
                    isCaused: false,
                    quantity: 1,
                    price: 520,
                    sumTotal: 520,
                    mngRate: 0.8,
                    manageFee: 568
                }
            ],
            attachments: [
                {
                    id: '1',
                    filePath: 'dadad',
                    fileName: '文件1'
                }
            ],
            claimApplyWorkItemDetailHis: [
                {
                    id: '1',
                    usedPartCode: 'usedPartCode',
                    laborCode: 'laborCode',
                    laborName: 'laborName',
                    laborHour: 12,
                    price: 213.00,
                    laborAmount: 2020.00
                }
            ],
            claimApplyProcessDetailHis: [
                {
                    status: '15011001',
                    operateDate: '2019-12-26T05:31:57.056Z',
                    handlerName: '刘德华',
                    remark: '牛逼'
                }
            ]
        }
    });
});
module.exports = router;
